﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Media.Imaging;
using DOMercury.Interfaces;


namespace Bezel__
{
    class HasSubIndexToDoubleConverter : IValueConverter
    {

        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string itemType = "default";
            if (value != null)
            {
                if (DOMercury.Engine.Interface.EngineCore.HasSubIndex(((IItem)(value)).ItemType))
                {
                    return 1d;
                }
                return 0d;
            }
            else
            {
                return 0d;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return false;
        }

        #endregion
    }
}
